1. Calculate the card odds
In [1]:
KNOWN = 5
UNKNOWN = 47
def card_odds(outs):
duds = UNKNOWN - outs
#return '%d:%d' % (duds, outs)
return '%d:%d' % (round(duds/outs), 1)
print(card_odds(1))
print(card_odds(6))
print(card_odds(11))
print(card_odds(16))
print(card_odds(21))
print(card_odds(26))
print(card_odds(31))
print(card_odds(36))
2. Compare with pot odds
In [2]:
def pot_odds(pot, bet):
#return '%d:%d' % (pot, bet)
return '%d:%d' % (round(pot/bet), 1)
print(pot_odds(100,20))
print(pot_odds(100,40))
print(pot_odds(100,60))
print(pot_odds(100,80))
In [3]:
def call_or_fold_rat(outs, pot, bet):
#return ((UNKNOWN - outs)/outs) > pot/call
return 'call' if (UNKNOWN - outs)/outs < pot/bet else 'fold'
In [4]:
call_or_fold_rat(9,100,20)
Out[4]:
In [5]:
call_or_fold_rat(9,100,50)
Out[5]:
1. Calculate the card equity
In [6]:
def card_equity(outs):
return 2 * outs + 1
In [7]:
card_equity(9)
Out[7]:
2. Calculate the pot odds
In [8]:
def pot_equity(pot, bet):
return round(bet / (pot + bet) * 100)
In [9]:
pot_equity(100,20)
Out[9]:
In [10]:
def call_or_fold_pct(outs, pot, bet):
return 'call' if (2 * outs + 1) > (bet / (pot + bet) * 100) else 'fold'
In [11]:
call_or_fold_pct(9,100,20)
Out[11]:
In [12]:
call_or_fold_pct(9,100,50)
Out[12]:
outs | held | $\to$ | desired |
---|---|---|---|
2 | pair | $\to$ | trips |
4 | two pair | $\to$ | full house |
4 | gut shot | $\to$ | straight |
6 | overcards | $\to$ | pair |
8 | open-ended straight | $\to$ | straight |
9 | four flush | $\to$ | flush |
15 | straight & flush draw | $\to$ | straight or flush |
In [13]:
def call_or_fold_24(outs, pot, bet):
return 'call' if (2 * outs) > (bet / (pot + bet) * 100) else 'fold'
In [14]:
call_or_fold_24(9,100,20)
Out[14]:
In [15]:
call_or_fold_24(9,100,50)
Out[15]:
In [16]:
def stella(outs, pot, bet):
return 'call' if (2 * outs) > (bet / (pot + bet) * 100) else 'fold'
In [17]:
stella(9,100,20)
Out[17]:
In [ ]: